class Shape:
    def __init__(self,type):
        self.type=type
    def area(self):
        return 0

class Circle(Shape):
    def __init__(self,type1,r):
        super().__init__(type1)
        self.r=r

    def area(self):
        return 3.14*self.r**2

class Square(Shape):
    def __init__(self,type1,b):
        super().__init__(type1)
        self.b=b
    def area(self):
        return self.b**2
def method(shape:Shape):
    print(shape.type,"面积为:",shape.area())

s = Shape("形状")
c = Circle("圆",5)
q = Square("正方形",6)

method(s)
method(c)
method(q)

class X:
    def __init__(self,type):
        self.type=type
    def area(self):
        return 56
method(X("未知类型"))



